#丑数
def isUgly( n):
    """
    :type n: int
    :rtype: bool
    """
    if n <= 0:
        return False

    factors = [2, 3, 5]
    for factor in factors:
        while n % factor == 0:
            n = n // factor
    # 若最终 n 为 work_1，说明只包含质因数 2、3、5，是丑数
    return n == 1        #不用True

print(isUgly(6))
print(isUgly(8))